'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('user_extends', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER,
      },
      user_id: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        comment: '用户ID',
      },
      wechat_official_openid: {
        allowNull: false,
        type: Sequelize.STRING,
        defaultValue: '',
        comment: '微信公众号openid',
      },
      wechat_mini_openid: {
        allowNull: false,
        type: Sequelize.STRING,
        defaultValue: '',
        comment: '微信小程序openid',
      },
      wechat_native_openid: {
        allowNull: false,
        type: Sequelize.STRING,
        defaultValue: '',
        comment: '微信扫码登录openid',
      },
      wechat_unionid: {
        allowNull: false,
        type: Sequelize.STRING,
        defaultValue: '',
        comment: '微信unionid',
      },
      deleted_at: {
        type: Sequelize.DATE,
      },
      created_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      updated_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('user_extends');
  },
};
